import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:get/get_connect/http/src/utils/utils.dart';

class AlignDemo extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _AlignDemoState();
}

class _AlignDemoState extends State<AlignDemo> {
  bool value = false;
  @override
  void initState() {
    debugPrint("1.initState");
    super.initState();
  }

  @override
  void didChangeDependencies() {
    
    debugPrint("2.didChangeDependencies");
    super.didChangeDependencies();
  }

  @override
  void didUpdateWidget(_) {
    debugPrint("didUpdateWidget");
    super.didUpdateWidget(this.widget);
  }

  @override
  Widget build(BuildContext context) {
    debugPrint("3.build");
    return Align(
      //可以设置子元素在空间的任意位置
      //alignment: Alignment(-0.3,0.4),
      alignment: Alignment.centerLeft,
  
      child: TextButton(
        onPressed: () {
          setState(() {
            value = !value;
          });
        },
        child: Text("Change $value",
        
        style: const TextStyle(
          // color: Colors.black,
          // backgroundColor: Colors.white,
          fontSize: 20),),
      ),
    );
  }
}
